package com.sogoodsoft.entity.crm;


import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.sogoodsoft.entity.IdEntity;
import com.sogoodsoft.entity.app.SysClass;

/**
  *SMS对象模型
  */
@Entity
@Table(name = "SMS")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Sms extends IdEntity implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

/** 接收手机号 */
private String target;
/** 接收人姓名 */
private String name;
/** 短信内容 */
private String msg;
/** 短信任务ID */
private Long taskid;
/** 发送状态 待发送 发送成功 发送失败 */
private Long status;
/** 发送时间 */
private Date sendtime;

/** 设定的发送日期和时间 */
private Date plantime;

/** 最后更新时间 */
private Date updatedate;

private Smstask task;

private SysClass sendSatus;

/**
*获取接收手机号
*@return 接收手机号
*/
@Column(name = "TARGET")
public String getTarget() {
return this.target;
}
/**
设置接收手机号
*@param target 接收手机号
*/
public void setTarget(String target) {
this.target = target;
}
/**
*获取短信内容
*@return 短信内容
*/
@Column(name = "MSG")
public String getMsg() {
return this.msg;
}
/**
设置短信内容
*@param msg 短信内容
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
*获取短信任务ID
*@return 短信任务ID
*/
@Column(name = "TASKID",insertable=false,updatable=false)
public Long getTaskid() {
return this.taskid;
}
/**
设置短信任务ID
*@param taskid 短信任务ID
*/
public void setTaskid(Long taskid) {
this.taskid = taskid;
}
/**
*获取发送状态 待发送 发送成功 发送失败
*@return 发送状态 待发送 发送成功 发送失败
*/
@Column(name = "STATUS",insertable=false,updatable=false)
public Long getStatus() {
return this.status;
}
/**
设置发送状态 待发送 发送成功 发送失败
*@param status 发送状态 待发送 发送成功 发送失败
*/
public void setStatus(Long status) {
this.status = status;
}
/**
*获取发送时间
*@return 发送时间
*/
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "SENDTIME")
public Date getSendtime() {
return this.sendtime;
}
/**
设置发送时间
*@param sendtime 发送时间
*/
public void setSendtime(Date sendtime) {
this.sendtime = sendtime;
}

@ManyToOne(cascade={},optional=true)
@JoinColumn(name="TASKID")
public Smstask getTask() {
	return task;
}
public void setTask(Smstask task) {
	this.task = task;
}


@ManyToOne(cascade={CascadeType.REFRESH,CascadeType.MERGE},optional=true)
@JoinColumn(name="STATUS")
public SysClass getSendSatus() {
	return sendSatus;
}
public void setSendSatus(SysClass sendSatus) {
	this.sendSatus = sendSatus;
}
/**
*获取最后更新时间
*@return 最后更新时间
*/
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "UPDATEDATE")
public Date getUpdatedate() {
	if(updatedate==null)updatedate=new Date();
return this.updatedate;
}
/**
设置最后更新时间
*@param updatedate 最后更新时间
*/
public void setUpdatedate(Date updatedate) {
this.updatedate = updatedate;
}

@Temporal(TemporalType.TIMESTAMP)
@Column(name = "PLANTIME")
public Date getPlantime() {
	return plantime;
}
public void setPlantime(Date plantime) {
	this.plantime = plantime;
}
@Column(name = "NAME")
public String getName() {
	return name;
}
public void setName(String name) {
	this.name = name;
}

}